export const fract = (num: number) => {
    return num - Math.trunc(num);
}


export const sigFigs = (num: number | string, digs = 3): string => {
    try {
        const formatted = Number(num).toFixed(digs);
        return parseFloat(formatted).toString();
    } catch (error) {
        console.error(error)
        return String(num)
    }


}